import request from '@/utils/request.js'
// (path, params = {}, loading = true, method = "POST")  接口要传递的参数

/**
 * @param mobile
 * @param type [forget=找回密码 register=注册 modify=修改手机号 modify_old = 修改手机号原手机号获得验证码 bank = 绑定提现信息 rider = 骑手申请]
*/
// 获取验证码
export const GetYzmApi = (params) => {
	return request('/system/sms/send_sms', params)
}
// 短信验证
export const SMSAuthApi = (params) => {
	return request('/system/sms/checkVerifyCode', params)
}
// 上传图片
/**
 * @param file
*/
export const uploadImgApi = async (params) => {
	const res = await uni.uploadFile({
		// 需要上传的地址
		url: import.meta.env.VITE_APP_BASE_URL + '/system/basic/postUploadOne',
		filePath: params,
		fileType: 'image',
		name: 'img'
	});
	return JSON.parse(res.data)
}
// 获取协议
/**
 * @returns register_rule=用户协议 privacy_policy=隐藏协议
*/
export const GetAgreementApi = (params) => {
	return request('/system/basic/conf', params)
}
// 获得省市区 {{host}}/system/basic/getRegion
/**
 * @param region
*/
export const GetRegionApi = (params) => {
	return request('/system/basic/getRegion', params)
}
